package com.len.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum PayStatusEnums {

    WAIT_PAY(0, "待支付"),
    FINISH_PAY(1, "已支付"),
    APPLY_REFUND(2, "退款申请中"),
    FINISH_REFUND(3, "已退款");

    private Integer code;
    private String message;

    public static PayStatusEnums getEnumByCode(Integer code) {
        if (code != null) {
            for (PayStatusEnums _enum : values()) {
                if (_enum.getCode().equals(code)) {
                    return _enum;
                }
            }
        }
        return null;
    }

}
